<template>
	<view class="container">
		<view class="content-box">
			<view class="content-total">
				共 {{total}} 条记录
			</view>
			<view class="empty-review" v-if="list.length == 0">
				<image src='../static/images/empty-review.png' mode="aspectFit"></image>
			</view>
			<view class="content-list">
				<view class="content-item" v-for="item in list" :key="item.id">
					<view class="content-item-info">
						<view class="content-item-info-name">
							{{item.ip}}
						</view>
						<view class="content-item-info-time">
							{{item.create_time_text}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>


<script>
import {loginLog} from '@/api/part2.js'
export default {
	data() {
		return {
			fromData: {
				page: 1,
				page_size: 10,
				keyword:''
			},
			total: 0,
			list:[
			]
		};
	},
	onLoad(options) {
		this.init()
	},
	async onReachBottom() {
		this.fromData.page++
		this.init()
	},
	methods: {
		changekeword(){
			this.fromData.page = 1
			this.init()
		},
		init() {
			loginLog(this.fromData).then(res => {
				console.log(res.data.data);
				res.data.data.data.forEach((item) => {
					this.list.push(item)
				})
				this.total = res.data.data.total
			})
		},
	},
};
</script>

<style lang="less" scoped>
	.search-box {
		padding: 12rpx 20rpx 24rpx 32rpx;
		background-color: #fff;
		display: flex;
	}
	.add-btn {
		padding: 20rpx;
	}
	.content-box {
		padding: 0 32rpx;
	}
	.content-total {
		padding: 16rpx 0;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 22rpx;
		color: #999999;
	}
	.content-item {
		background: #FFFFFF;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0,0,0,0.01);
		border-radius: 24rpx;
		padding: 24rpx;
		margin-bottom: 24rpx;
		display: flex;
		gap: 24rpx;
	}
	.content-item-img {
		width: 90rpx;
		height: 90rpx;
		border-radius: 12rpx;
	}
	.content-item-info {
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.content-item-info-name {
		font-family: PingFangHK, PingFangHK;
		font-weight: 500;
		font-size: 30rpx;
		color: #222222;
	}
	.content-item-info-time {
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #444444;
	}
	.empty-review {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 48rpx 0;
	
		image {
			width: 328rpx;
			height: 208rpx;
			margin-bottom: 24rpx;
		}
	}
</style>